home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / utils / poplibsr.arc / README < prev    next >
Text File  |  1988-08-19  |  3KB  |  71 lines

  1. Shared Library Support - Experimental
  2. -------------------------------------
  3.  
  4. The included files make up the pieces you need to create and use
  5. shared libraries on the Atari ST.  Note that this is a experimental
  6. version.  I would like your feedback, especially constructive
  7. comments! :-)
  8.  
  9. Shared libraries are a useful way of factoring the common code out of
  10. your programs.  If you have a number of programs that use many of the
  11. same routines then you may want to use a shared library.
  12.  
  13. In this scheme, shared libraries are installed at boot time.  Each
  14. library maintains an array of pointers to it's externally accessible
  15. entry points.  Programs that use a shared library acquire a pointer to
  16. the library's entry points.  An entry point is called by jumping
  17. through the array.  
  18.  
  19. The program LIBS.PRG (containing the basic shared library support)
  20. should be placed in your AUTO folder, followed by the shared libraries
  21. themselves.  An example library XLIB.PRG is included in this
  22. distribution.  At boot time GEM will execute LIBS.PRG, installing the
  23. needed shared libraries support.  As each library is executed it will
  24. perform any needed initialization and install itself in memory.
  25.  
  26. Note that the order of the files in the AUTO folder is critical.  The
  27. program LIBS.PRG must preceed any libraries.  Also note that if a
  28. library is dependent on the presence of another library, then the
  29. library on which it depends must be installed first.
  30.  
  31. One of the interested possibilities offered by this scheme is the
  32. ability to easily make incremental changes to existing libraries to
  33. which you may not have the source.  If there is a known bug in a
  34. library, you could come up with a 'patch' that replaces the offending
  35. entry in the library's jump table with a pointer to your own routine.
  36.  
  37. Support routines
  38. ----------------
  39.  
  40. -- int InitLibSupport()
  41.  
  42. Called by any program using shared libraries to initialize the shared
  43. library support.  Returns 0 if the shared library support is NOT
  44. installed.
  45.  
  46. -- InstallLibrary(lib_link,keep)
  47.  
  48. Called by a library to install itself.
  49.  
  50. -- Library FindLibrary(lib_name,lib_version)
  51.  
  52. Called by a program to find an installed library.  Returns 0 if the
  53. library is not found, or a pointer to the library's array of entry
  54. points.
  55.  
  56. This distribution contains the following:
  57.  
  58.     LIBS.H        - included by all code using shared libraries
  59.     LIBS.C        - terminate & stay resident library support
  60.     LIB_INIT.C    - module linked in by programs using libraries
  61.     LIB_INST.C    - module linked in by installable libraries
  62.     
  63.     XLIB.H        - interface to example library
  64.     XLIB.C        - example library
  65.     
  66.     XTEST.C        - program that uses example library 
  67.     
  68.     MAKEFILE    - to put all of the above together
  69.  
  70. This code was developed using Mark Williams C.
  71.